<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">  
    <title>My JSP 'ex9-check.jsp' starting page</title>  
  </head>  
  <body>
    <%
    	request.setCharacterEncoding("utf-8"); 
    	String username=request.getParameter("user");
    	String userpwd=request.getParameter("pwd");
    	if(username.equals("张三") && userpwd.equals("abc123")){
     %>
     <jsp:forward page="ex9-main.jsp">
     	<jsp:param name="user" value="<%=username %>"/>
	 </jsp:forward>
	 <%
	 	}else{
	  %>
	  <jsp:forward page="ex9.jsp"></jsp:forward>
	  <%
	  }
	   %>   	
  </body>
</html>
